package com.jiuyun.auth.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class Dbutil {
    static String url="jdbc:mysql://localhost:3306/authority?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai";
    static String user="root";
    static String pass="123456";

    public static Connection getConn(){
        Connection conn=null;
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            //获取连接
            conn = DriverManager.getConnection(url,user,pass);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return conn;

    }
    public static void main(String[] args){
        System.out.println(Dbutil.getConn());
    }
}
